// components/StBarpie/StBarpie.js
Component({
    options:{
        multipleSlots: true, //多slot支持
        addGlobalClass: true
    },
    /**
     * 组件的属性列表
     */
    properties: {
        status:{
            type: Number,
            value: 0
        },
        todayIsClear:{
            type: Number,
            value: 1
        },
        clearScore:{
            type: Number,
            value: 0
        },
        carId:{
            type: Number,
            value: 0
        },
        toggleDelay:{
            type: Boolean,
            value: true
        },
    },

    /**
     * 组件的初始数据
     */
    data: {
        modalName: null
    },

    /**
     * 组件的方法列表
     */
    methods: {
        _clearCar(e){
            if (this.data.status == 1 && this.data.todayIsClear == 0) {
                this.triggerEvent('clearCar', e.currentTarget.dataset.cid);
            }
        },
        _showHot(){
            this.triggerEvent('showHot');
        },
        reloadAnimation(){
            this.setData({
                toggleDelay: true
            });
            let self = this;
            setTimeout(() => {
                self.setData({
                    toggleDelay: false
                })
            }, 1100);
        },
    },
    lifetimes: {
        attached: function () {
            let self = this;
            setTimeout(() => {
                self.setData({
                    toggleDelay: false
                })
            }, 1100);
        },
        moved: function () {},
        detached: function () {},
    },
})
